package com.cnhaimei.vod.logic;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.cnhaimei.base.TransparentActivity;
import com.cnhaimei.vod.R;
import com.cnhaimei.vod.net.dc.Player;
import com.cnhaimei.vod.util.Const;

/**
 * 更多设置界面
 * 
 * @author funwell <br>
 * @date 2013-6-04
 * 
 */
public class MoreSettingActivity extends TransparentActivity implements OnClickListener{
		
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.v8_more_setting);
		
		setClickable(R.id.rechoose_room, R.id.call_service, R.id.singed, R.id.chose, R.id.mute, R.id.mood, R.id.help, 
					R.id.cancel, R.id.replay, R.id.back, R.id.light);
		
		boolean isSilent = Player.G().getSlient() == 1 ? true : false;
		if (isSilent) {
			((TextView)findViewById(R.id.mute)).setText("取消静音");
		} else {
			((TextView)findViewById(R.id.mute)).setText("静音");
		}
	}
	
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.rechoose_room:// 重新绑定房台
			setResult(Const.ResultCode.RECHOOSE_ROOM);
			break;
		case R.id.call_service:
			setResult(Const.ResultCode.CALL_SERVICE);
			break;
		case R.id.singed:
			setResult(Const.ResultCode.SINGED);
			break;
		case R.id.chose:
			setResult(Const.ResultCode.CHOSE);
			break;
		case R.id.mute://静音
			setResult(Const.ResultCode.MUTE);
			break;
		case R.id.mood://气氛控制
			setResult(Const.ResultCode.MOOD);
			break;
		case R.id.help:
			setResult(Const.ResultCode.HELP);
			break;
		case R.id.cancel://取消
			setResult(RESULT_CANCELED);
			break;
		case R.id.replay://重唱
			setResult(Const.ResultCode.REPLAY);
			break;
		case R.id.light://灯光控制
			setResult(Const.ResultCode.LIGHT);
			break;
		case R.id.back://no break
		default:
			break;
		}
		finish();
	}
	
}
